package com.yty.demo._4_oop;

/**
 * @author: yangtaoyao
 * @time: 2020/1/7 16:04
 * @description: 圆柱
 */
public class Cylinder extends Circle{
    private double length;

    public double getLength() {
        return length;
    }

    public Cylinder(){
        length=1;
    }

    public Cylinder(double length) {
        this.length = length;
    }

    public Cylinder(double radius, double length) {
        super(radius);
        this.length = length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double findVolume(){
        return this.calculate()*this.length;
    }

    public static void main(String[] args) {
        Cylinder cylinder=new Cylinder(10,23);
        System.out.println(cylinder.findVolume());
    }
}
